package com.lx.pc.service.transactionog.impl;

import java.math.BigInteger;
import java.util.List;

import org.springframework.stereotype.Service;

import com.lx.pc.domain.entity.transactionlog.TransactionLogEntity;
import com.lx.pc.domain.vo.transactionlog.TransactionLogVo;
import com.lx.pc.mybatis.repository.transactionlog.TransactionLogRepository;
import com.lx.pc.service.AbstractService;
import com.lx.pc.service.transactionog.ITransactionLogService;
import com.lx.pc.utils.OmsPage;

@Service("transactionLogService")
public class TransactionLogServiceImpl extends AbstractService<TransactionLogEntity, TransactionLogVo, BigInteger, TransactionLogRepository> implements ITransactionLogService{

	@Override
	public int findByTransactionLogCount(TransactionLogVo transaction) {
		return repository.findByTransactionLogCount(transaction);
	}

	@Override
	public OmsPage<TransactionLogVo> findByTransactionLog(TransactionLogVo transaction, Integer page, Integer size) {
		OmsPage<TransactionLogVo> pages = new OmsPage<TransactionLogVo>();
		pages.setTotal(repository.findByTransactionLogCount(transaction));
		List<TransactionLogEntity> list = repository.findByTransactionLog(transaction,page = (page - 1) * size,size);
		pages.setResult(etoV(list));
		return pages;
	}

}
